package com.yuan.rest.controller.admin;

import com.yuan.rest.repository.SysUserRepository;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;

/**
 * @Auther: SiYuan
 * @Date: 2019/3/4 14:44
 * @Description:
 */

@RequestMapping("/admin")
@Controller
public class AdminController {

    @Autowired
    SysUserRepository sysUserRepository;
    /***
     * 跳转登录
     * @return
     */
    @GetMapping("/login")
    public String login() {
        return "admin/login";
    }

    /***
     * 登录验证
     * @param name
     * @param password
     * @return
     */

    @PostMapping("/login")
    public String admin(@RequestParam("name") String name ,@RequestParam("password") String  password){
        /***
         * 最简单的验证
         */
        System.out.println( name + password);
        return "admin";
    }
}
